﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BarcodeSmallImg.aspx.cs" Inherits="Ewts.Production.BarcodeSmallImg" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>小标签打印</title>

<style type="text/css">
body {
	margin: 0px;
	padding: 0px;
	font-size:12px 
}
.bc_code_01
{
    line-height:80%;
}
table.bci_tb1
{
    width:270px;
    border:1px;
    position:relative;
    top:22px;
    left:8px;
}
table.bci_tb2
{
    width:282px;
    position:relative;
    top:100px;
    left:3px;
}
div.bci_div
{
    position:relative;
    top:50px;
}
td.barcode_td_x
{
    text-align:center;
    white-space:nowrap;
    padding:0px;
    padding-right:5px;
    margin:0px;
}
td.td_1
{
    width:50px;
}
td.td_2
{
    width:125px;
}
td.td_3
{
    width:35px;
    white-space:nowrap;
}
td.td_4
{
    width:60px;
}

</style>
</head>
<body>
<div id="idobj" style="height:0;">
    <object id="secmgr" codebase="smsx.cab#Version=6,5,439,72" classid="clsid:5445BE81-B796-11D2-B931-002018654E2E" viewastext>
        <param name="GUID" value="{8C605D40-A0B9-CE77-D0C7-3BD0288E9BD6}"/>
        <param name="PATH" value="sxlic.mlf"/>
        <param name="REVISION" value="0" />
        <param name="PerUser" value="true"/ >
    </object>
    <object id="factory" classid="clsid:1663ED61-23EB-11D2-B92F-008048FDD814"  viewastext>
        <param name="template" value="MeadCo://IE7"/>
    </object>
</div>  
    <form id="form1" runat="server">
 <!--startprint-->
<table class="bci_tb1" cellpadding="2" cellspacing="0" width="270" border="1">
  <tr>
    <td class="td_1">LOAD</td>
    <td class="td_2"width="125"><label id="lblLoad" runat="server"></label></td>
    <td class="td_3"width="35px">日期</td>
    <td class="td_4"width="60px"><label id="lblDate" runat="server"></label></td>
  </tr>

  <tr>
    <td>描述</td>
    <td><label id="lblGoodsName" runat="server"></label></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td>数量</td>
    <td><label id="lblqty" runat="server"></label></td>
    <td>净重</td>
    <td><label id="lblnwt" runat="server"></label>kg</td>
  </tr>
  <tr>
    <td colspan="4" align="center">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td style="width:100%;"> <asp:Image ID="img1" runat="server" /></td>
        </tr>
        <tr class="bc_code_01">
            <td>
                <font size="1">
                    <label id="lblCode1" runat="server"></label>
                </font>
            </td>
        </tr>
    </table>
       
        
      </td>
  </tr>
</table> 
<table class="bci_tb2" style="width:270px;">
        <tr style="vertical-align:middle; line-height:0px;position:relative; bottom:0px; padding:0px; margin:0px;">
        <td class="barcode_td_x"><font size="1"><label id="lblcutomer" runat="server"/></font></td>
        <td class="barcode_td_x"><font size="1">净重:<label id="lblnwt_b" runat="server"/>kg</font></td>
        <td class="barcode_td_x"><font size="1">数量:<label id="lblqty2" runat="server"/></font></td>
        </tr>
        <tr style="margin: 5px">
            <td colspan="3">
                 <asp:Image ID="img2" runat="server" />
              
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <font size="1">
                    <label id="lblCode2" runat="server"></label>
                </font>
            </td>
        </tr>
</table>


 <script language="Javascript" type="text/javascript">

     function getPrintName() {
         var printname = "0";
         var index = 0;
         while (1) {
             if (printname != "" && printname != null) {
                 printname = factory.printing.EnumPrinters(index);
                 if (printname.indexOf("打印机1") != "-1") {
                     break;


                 }
                 index++;
             }
             else {
                 break;
             }

         }
         return printname;
     }


     function PrintSetup() {
         document.getElementById("idobj").style.display = "none"; //显示按钮
         factory.printing.printer = getPrintName(); //指定使用的打印机
         factory.printing.paperSize = "MSF"; //指定使用的纸张
         factory.printing.header = "";
         factory.printing.footer = "";
         factory.printing.leftMargin = 0;
         factory.printing.rightMargin = 0;
         factory.printing.topMargin = 0;
         factory.printing.bottomMargin = 0;
     }

     window.onload = function () {
         PrintSetup();
         factory.printing.Print(false); //无确认打印，true时打印前需进行确认
         window.opener = null;
         window.open("", "_self");
         window.close(); //关闭窗口
     }

   
</script>
    </form>
</body>
</html>
